<?php



class Model_DbTable_Faulty_Rejectionlog extends Zend_Db_Table_Abstract {

	protected $_name = 'faulty_reject_log';

	public function getRejectionlog( $idRejection){

		$row = $this->fetchRow("`id_rejection` = ". $idRejection);
		if(!$row) return false;
		return $row->toArray();

	}

	public function addRejectionlog( $idFaulty , $idStaff , $detail , $acceptDate){

		$data = array(
					
				"id_faulty" =>  $idFaulty ,
				"id_staff" =>  $idStaff ,
				"detail" =>  $detail ,
				"accept_date" =>  $acceptDate

		);
		$this->insert($data);

	}

	public function updateRejectionlog(  $idRejection ,  $idFaulty , $idStaff , $detail , $acceptDate){
		$data = array(
					
				"id_faulty" =>  $idFaulty ,
				"id_staff" =>  $idStaff ,
				"detail" =>  $detail ,
				"accept_date" =>  $acceptDate

		);
			
		$this->update($data,"`id_rejection` = ". $idRejection);
	}

	public function deleteRejectionlog( $idRejection){

		$this->delete("`id_rejection` = ". $idRejection);

	}

	public function listAll(){

		$rows =$this->fetchAll("1","id_rejection DESC ");
		if(!$rows) return false;
		return $rows->toArray();

	}
}


?>